<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增违规记录')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-illegalRecord-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">违规类型：</label>
                <div class="col-sm-8">
                    <select name="illegalTypeId" class="form-control m-b" th:with="type=${@illegalType.getIllegalType()}" required>
                        <option th:each="dict : ${type}" th:text="${dict.illegalTypeName}" th:value="${dict.id}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">学生：</label>
                <div class="col-sm-8">
                    <input id="studentName"  class="form-control" type="text" onclick="selectStudent()">
                    <input id="studentId" name="studentId" class="form-control" type="hidden" >
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">详情：</label>
                <div class="col-sm-8">
                    <textarea name="detail" class="form-control" ></textarea>
                </div>
            </div>

        </form>
    </div>


    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "school/illegalRecord"
        $("#form-illegalRecord-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-illegalRecord-add').serialize());
            }
        }

        function selectStudent(){
            $.modal.open("选择学生", ctx + "school/student" + "/query");
        }
    </script>
</body>
</html>